package com.onpositive.gamemaker.visualizer.swt;


import com.onpositive.gamemaker.core.GraphicDevice;
import com.onpositive.gamemaker.core.ISprite;

public class BasicSprite implements ISprite
{
	protected final String id;
	protected String imageId;

	public BasicSprite(String id)
	{
		this.id = id;
	}
	
	public BasicSprite(String id, String imageId)
	{
		this(id);
		this.imageId = imageId;
	}

	@Override
	public String getId()
	{
		return id;
	}

	@Override
	public void paint(int x, int y, int width, int height, GraphicDevice context)
	{		
//		if (image == null)
//		{
//			image = SWTImageManager.getImage(imageId);
//		}
//		if (context instanceof GC)
//		{
//			GC gc = (GC) context;
			int radius = width / 2;
//			int[] clipArray = getHexagonCoordArray(x, y, radius);
//			Region region = new Region();
//			region.add(clipArray);
//			gc.setClipping(region);
//			ImageData imageData = image.getImageData();
//			imageData.transparentPixel = -1;
			context.drawHexImage(imageId,x,y,width,height);
			context.drawHexGrid(x,y,radius);
			//TODO debug
//			gc.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLUE));
//			gc.setLineAttributes(new LineAttributes(1));
//			gc.drawPolygon(clipArray);
//			region.dispose();
		//}		
	}
	
}
